package org.dtrd.modules.archive.service.impl;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.dtrd.modules.archive.entity.po.DtrdEntRdArchiveBasicFamily;
import org.dtrd.modules.archive.mapper.DtrdEntRdArchiveBasicFamilyMapper;
import org.dtrd.modules.archive.service.IDtrdEntRdArchiveBasicFamilyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Set;

/**
@author 萧
@date 2021-10-01 22:47:26
**/
@Service
@DS("multi-datasource1")
@Slf4j
public class DtrdEntRdArchiveBasicFamilyServiceImpl extends ServiceImpl<DtrdEntRdArchiveBasicFamilyMapper, DtrdEntRdArchiveBasicFamily> implements IDtrdEntRdArchiveBasicFamilyService {

    @Autowired
    private DtrdEntRdArchiveBasicFamilyMapper basicFamilyMapper;

    @Override
    public void removeByPatientIds(Set<Integer> patientIds) {
        basicFamilyMapper.deleteByPatientIds(patientIds);
    }

    public void updateDataByOcr(Integer patientId, String field, String value) {
        System.out.println("hello, im in");
        log.info(patientId + "==" + field + "===" + value);
        baseMapper.updateDataByOcr(patientId, field, value);
    }
}
